import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { Router } from '@angular/router';
import { LocalStorage } from 'app/ptpmc/localstorage/local.storage';
import { UserModel } from '../model/sys/user-model';
import { Notifycation } from '../comm/notifycation';

@Injectable()
export class AuthGuard implements CanActivate {

    constructor(
        private router: Router
    ) { }

    canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
        // if (UserModel.userId === undefined) {
        //     Notifycation.showNotification('用户数据丢失，请重新登陆', 'danger');
        //     this.router.navigate(['']);
        //     return false;
        // }
        return true;
    }
}